<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'app',
  data () {
    return {
    }
  },
  mounted () {
    // this.getUser()
    // this.getCartCount()
  },
  methods: {
    getUser () {
      this.$axios.get('/user').then(res => {
        console.log('res: ', res)
        this.$store.dispatch('setUserName', res.data.username)
      })
    },
    getCartCount () {
      this.$axios.get('/carts/products/sum').then(res => {
        console.log('res: ', res)
        this.$store.dispatch('setCartCount', res.data)
      })
    }
  }
}
</script>

<style lang="scss">
@import './assets/scss/reset.scss';
@import './assets/scss/config.scss';
@import './assets/scss/button.scss';
</style>
